﻿using BCCommon.Enums;
using BCEntity.WeChatComponent.WeChatMessageRecord;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCData.WeChatComponent.WeChatMessageRecord
{
    /// <summary>
    /// 微信消息记录数据处理接口
    /// </summary>
    public interface IWeChatMessageRecordData
    {
        /// <summary>
        /// 添加微信消息记录
        /// </summary>
        /// <param name="weChatMessageRecordEntity">微信消息记录</param>
        /// <returns></returns>
        WeChatMessageRecordEntity Add(WeChatMessageRecordEntity weChatMessageRecordEntity);
        /// <summary>
        /// 更新已回复状态
        /// </summary>
        /// <param name="weChatMessageRecordId">微信消息记录Id</param>
        /// <returns></returns>
        WeChatMessageRecordEntity UpdateRepliedStatus(long weChatMessageRecordId);
        /// <summary>
        /// 读取单条消息记录
        /// </summary>
        /// <param name="weChatMessageRecordId">微信消息记录Id</param>
        /// <returns></returns>
        WeChatMessageRecordEntity GetEntity(long weChatMessageRecordId);
        /// <summary>
        /// 读取消息记录列表（分页）
        /// </summary>
        /// <param name="recordId">消息记录Id</param>
        /// <param name="fromUserName">发送者</param>
        /// <param name="toUserName">接受者</param>
        /// <param name="weChatMessageType">消息类型</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="isReplied">已回复</param>
        /// <param name="eventName">事件名称</param>
        /// <param name="eventKey">事件Key值</param>
        /// <param name="ascending">排序</param>
        /// <param name="dataCount">数据总数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <param name="mainMessage">主消息</param>
        /// <returns></returns>
        IEnumerable<WeChatMessageRecordEntity> Get(long? recordId, string fromUserName, string toUserName, WeChatMessageType? weChatMessageType,DateTime? start,DateTime? end, bool? isReplied, string eventName,string eventKey,bool? ascending,out int dataCount,int pageIndex=1,int pageSize=10,bool mainMessage=true);
    }
}
